import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
const News = () => import('../views/News.vue')
const Travel = () => import('../views/Travel.vue')
const Active = () => import('../views/Active.vue')
const Message = () => import('../views/Message.vue')
const Login = () => import('../views/Login.vue')

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'home',
    component: Home,
    meta: { isShow: true }
  },
  {
    path: '/news',
    name: 'news',
    component: News,
    meta: { isShow: true, title: '新闻公告' }
  },
  {
    path: '/travel',
    name: 'travel',
    component: Travel,
    redirect: '/travel/scenic',
    meta: { isShow: true },
    children: [
      {
        path: 'scenic',
        name: 'scenic',
        component: () => import('../views/TravelScenic.vue'),
        meta: { isShow: true, title: '景点介绍' }
      },
      {
        path: 'route',
        name: 'route',
        component: () => import('../views/TravelRoute.vue'),
        meta: { isShow: true, title: '精选路线' }
      },
      {
        path: 'story',
        name: 'story',
        component: () => import('../views/TravelStory.vue'),
        meta: { isShow: true, title: '红色故事' }
      }
    ]
  },
  {
    //景点详情
    path: '/scenicsDetail',
    name: 'scenicsDetail',
    component: () => import('../views/ScenicsDetail.vue'),
    meta: { isShow: true, title: '景点介绍' }
  },
  {
    // 路线详情
    path: '/routesDetail',
    name: 'routesDetail',
    component: () => import('../views/RoutesDetail.vue'),
    meta: { isShow: true, title: '精选路线' }
  },
  {
    path: '/active',
    name: 'active',
    component: Active,
    meta: { isShow: true, title: '活动演出' }
  },
  {
    path: '/message',
    name: 'message',
    component: Message,
    meta: { isShow: true, title: '游记分享' }
  },
  {
    path: '/login',
    name: 'login',
    component: Login,
    meta: { isShow: false }
  }
]

const router = new VueRouter({
  routes
})

export default router
